import request from '@/utils/request'

// 查询课程管理列表
export function list(query) {
  return request({
    url: '/crm/reports/statistics',
    method: 'get',
    params: query
  })
}

export function selectLable(data, value) {
  return data.find(item => item.value == value).label
}

// 暂时hardcode表信息
let tableList = new Array();
tableList['tb_contract'] =
  {
    selectColumnList: [
      {'label':'部门', 'value':'dept_id'},
      {'label':'归属', 'value':'create_by'},
      {'label':'渠道', 'value':'channel'},
      {'label':'意向学科', 'value':'subject'},
      {'label':'课程', 'value':'course_id'},
    ],
    countColumnList:[
      {'label':'ID', 'value':'id'},
      {'label':'归属', 'value':'create_by'},
      {'label':'渠道', 'value':'channel'},
    ],
    aggregationColumnList:[{'label':'课程原价', 'value':'course_price'}, {'label':'订单价格', 'value':'contract_order'},],
}
tableList['tb_business'] =  {
    selectColumnList: [
      {'label':'省', 'value':'provinces'},
      {'label':'市', 'value':'city'},
      {'label':'性别', 'value':'sex'},
      {'label':'年龄', 'value':'age'},
      {'label':'活动', 'value':'activity_id'},
      {'label':'意向学科', 'value':'subject'},
      {'label':'课程', 'value':'course_id'},
    ],
    countColumnList:[{'label':'ID', 'value':'id'},],
    aggregationColumnList:[],
}
export {tableList}
